/**
 * Created by zhang on 4/27/2017.
 */
const assert = require('assert');

/**
 * assert(value[, message])
 */
assert(true);
assert(1);


assert(false); // throw new assert.AssertionError: false == true
assert(0); // throw new assert.AssertionError: 0 == true
assert(false, 'not true'); // throw new assert.AssertError: not true

/**
 * assert.deepEqual(actual, expected[, message])
 * assert.deepStrictEqual(actual, expected[, message])
 */
const obj1 = {
    a: {
        b: 1
    }
};
const obj2 = Object.create(obj1);

assert.deepEqual(obj1, obj2); // throw AssertError: { a: { b: 1 } } deepEqual {}

/**
 * assert.doesNotThrow(block[, error][, message])
 */
assert.doesNotThrow(
    () => {
        throw new TypeError('type error');
    },
    TypeError,
    'error message'
);

assert.equal(1, 2)
assert.fail(1, 2, undefined, '>');
assert.notEqual(1, 2)